﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Quartz;

namespace WeChartWorkRobot.Service.Jobs
{
    internal class QuaterzJob<T> : Quartz.IJob where T : IJob, new()
    {
        public void Execute(IJobExecutionContext context)
        {
            try
            {
                T job = new T();
                job.Execute(new ExecuteContext(context));
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine($"定时任务[{typeof(T).Name}]执行异常：" + ex.Message);
            }
        }
    }
}
